﻿Public Class Wire
    Private Plug1 As Plug
    Private Plug2 As Plug
    Private Sock1 As Socket
    Private Sock2 As Socket

    Private M_WorkSpace As DiagramPanel
    Public Sub CreateWire(ByVal Workspace As DiagramPanel)
        M_WorkSpace = Workspace
        Plug1 = New Plug
        M_WorkSpace.Controls.Add(Plug1)
        Plug1.SetCenter(-100, -100)
        Plug2 = New Plug
        M_WorkSpace.Controls.Add(Plug2)
        Plug2.SetCenter(-100, -100)
    End Sub
    Public Sub SetStartSocket(ByVal Socket As Socket)
        Sock1 = Socket
        'Plug1.SocketType = Sock1.SocketType
        'Plug1.ExitTo = Sock1.ExitTo
        'Plug1.SetCenter(Sock1.CenterPoint)
        'Plug1.BringToFront()
    End Sub
    Public Sub SetEndSocket(ByVal Socket As Socket)
        Sock2 = Socket
        'Plug2.SocketType = Sock2.SocketType
        'Plug2.ExitTo = Sock2.ExitTo
        'Plug2.SetCenter(Sock2.CenterPoint)
        'Plug2.BringToFront()
        Sock1.ConnectTo(Sock2)
    End Sub
    Public Property WorkSpace() As DiagramPanel
        Get
            Return M_WorkSpace
        End Get
        Set(ByVal value As DiagramPanel)
            M_WorkSpace = value
        End Set
    End Property
End Class
